{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "e211e6e9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "range(0, 10, 2) <class 'range'>\n",
      "[0, 2, 4, 6, 8]\n",
      "{0: 0, 2: 3, 4: 6, 6: 9, 8: 12}\n",
      "0 0\n",
      "2 3\n",
      "4 6\n",
      "6 9\n",
      "8 12\n",
      "xxxx 0 0\n",
      "xxxx 2 3\n",
      "xxxx 4 6\n",
      "xxxx 6 9\n",
      "xxxx 8 12\n"
     ]
    }
   ],
   "source": [
    "l = [213456,432,56,5,6]\n",
    "r = range(0,10,2)\n",
    "l = list(r)\n",
    "print(r, type(r))\n",
    "print(l)\n",
    "t = tuple(range(0,100,3))\n",
    "s = set(range(0,50,5))\n",
    "d = dict(zip(l, t)) #zip函数生成dict\n",
    "print(d)\n",
    "for i in d: #取k,v值\n",
    "    print(i,d[i])\n",
    "for k,v in d.items(): #.items是一个序列，可以获取dict里的k,v对\n",
    "    if i > 1000:\n",
    "        print(\"大于1000 exit\")\n",
    "        continue\n",
    "    print(\"xxxx\", k,v)\n",
    "\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "b292159b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 1\n",
      "1 3\n",
      "2 5\n"
     ]
    }
   ],
   "source": [
    "l = list(range(0,5,1))\n",
    "t = tuple(range(-5,1,1))\n",
    "s = set(range(1,7,2))\n",
    "for idx, val in enumerate(s): #enumerate函数用来输出坐标和值\n",
    "    print(idx, val)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "5e0c20f4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "add\n",
      "a + b =  246\n",
      "i + j =  246 None None\n",
      "[1]\n"
     ]
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a0481864",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
